var net=require('net'),cnt=0;
var server=net.createServer(function (conn) {
    conn.write(
        `Welcome to
        ${cnt}
        and enter:`
    );
    cnt++;
    conn.on('close', function () {
        console.log('close');
        cnt--;
    });
    conn.on('data', function (chunk) {
        console.log(chunk.toString('utf8'));
    });
});
server.listen(4000, function () {
    console.log('Listen 4000.');
});